package com.hao.gaoji;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class testPool {
    public static void main(String[] args) {
        // 1、创建服务，创建线程池
        ExecutorService service = Executors.newFixedThreadPool(10);
        MyThread myThread = new MyThread();
        // 执行
        service.execute(myThread);
        service.execute(myThread);
        service.execute(myThread);
        // 2、 关闭连接
        service.shutdown();

    }
}

class MyThread implements Runnable{
    @Override
    public void run() {
            System.out.println(Thread.currentThread().getName());
    }
}
